package com.dantfb.util;

import com.dantfb.constants.Constants;

/**
 * The Class NotificationUtil.
 */
public class NotificationUtil {
	
	/** The notification manager. */
	static NotificationUtil notificationManager;

	/**
	 * Instantiates a new notification util.
	 */
	public NotificationUtil() {

	}

	/**
	 * Gets the notification message.
	 *
	 * @param notification the notification
	 * @return the notification message
	 * @throws IllegalArgumentException the illegal argument exception
	 * @throws IllegalAccessException the illegal access exception
	 */
	public static String getNotificationMessage(String notification) throws IllegalArgumentException, IllegalAccessException {
		if(notification == null)
			return "";
		notification = notification + "_MESSAGE";
		try {
			notification = Constants.class.getField(notification).get(notificationManager).toString();
		} catch (Exception e) {
			notification="";
		}
		return notification;
	 
	}

	/**
	 * Gets the single instance of NotificationUtil.
	 *
	 * @return single instance of NotificationUtil
	 */
	public static NotificationUtil getInstance() {
		if (notificationManager == null)
			notificationManager = new NotificationUtil();
		return notificationManager;
	}

}
